package top.kaoshanji.r3ch11c;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests;
import org.testng.annotations.Test;

/**
 * 代码清单test-r3ch11c-01：测试一下TransactionProxyFactoryBean事务管理
 * @author kaoshanji
 * ^_^
 * create time 2025/5/9 14:46
 */
@ContextConfiguration(locations = {"classpath:r3ch11c/tx-pfb-beans.xml"})
public class BbtForumTest extends AbstractTransactionalTestNGSpringContextTests {

    @Autowired
    private BbtForum bbtForum;

    @Test
    public void bbtForumTest() throws Exception {
        System.out.println("begin........");

        Topic topic = new Topic();
        topic.setTopicTitle("Title -pfb");

        Post post = new Post();
        post.setPostText("post content -pfb");
        topic.setPost(post);

        bbtForum.addTopic(topic);

        System.out.println("end........");

    }

}
